<?php
namespace frontend\controllers;

use Yii;
use frontend\models\RbacUserRule;

/**
 * Home controller
 */
class RbacController extends BaseController
{

    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex()
    {

        $result = "rbac";
        return $result;
    }

    private function makeDevPermission() {
        $auth = Yii::$app->authManager;

        $dev = $auth->createPermission('dev');
        $dev->description = "dev permission";
        $auth->add($dev);

        $developer = $auth->createRole('developer');
        $developer->description = "developer role";
        $auth->add($developer);

        $auth->addChild($developer, $dev);

        $auth->assign($developer, '1');
    }

}
